<template>
  <div class="category">
    <h2>{{ title }}</h2>
    <!-- 默认插槽 -->
    <slot>我是默认插槽的默认内容</slot>
    <br>
    <!-- 具名插槽 -->
    <slot name="footer">我是具名插槽的默认内容</slot>
  </div>
</template>

<script setup lang="ts">
defineProps<{
  title: string
}>()
</script>

<style scoped>
.category {
  background-color: skyblue;
  border-radius: 10px;
  padding: 10px;
  width: 300px;
  height: 300px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.5);
}

h2 {
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  background-color: orange;
}
</style>